<?
layout("/inc/layout.html",{title:sysTitle}){
?>
<div id="page-wrapper">
	<!--BEGIN TITLE & BREADCRUMB PAGE-->
	<div id="title-breadcrumb-option-demo" class="page-title-breadcrumb">
		<div class="page-header pull-left">
			<div class="page-title">自然语言处理</div>
		</div>
		<ol class="breadcrumb page-breadcrumb pull-left">
			<li><i class="fa fa-home"></i>&nbsp;<a href="main.html">首页</a>&nbsp;&nbsp;<i
				class="fa fa-angle-right"></i>&nbsp;&nbsp;</li>
			<li>自然语言处理&nbsp;&nbsp;<i class="fa fa-angle-right"></i>&nbsp;&nbsp;</li>
			<li class="active">基于词表标注</li>
		</ol>
		<div class="clearfix"></div>
	</div>
	<!--END TITLE & BREADCRUMB PAGE-->
	<!--BEGIN CONTENT-->
	<div class="page-content" style="margin-left:50px; margin-right:50px;">
		
		<img src="images/slide2.png" width="70%" height="100px;"/>
		
		<div class="row" style="margin-top: 10px;">
			<!-- <div class="col-lg-12" style="margin-top: 10px;"> -->
				<div class="form-group">
					<div class="col-md-2" style="text-align:center"> 
						<label for="inputPhone" class="control-label pull-left"><h4>标题（title）:</h4></label>
					</div>
					<br/>
					<div class="col-md-12">
						<input id="title" type="text" class="form-control"  name="title" value="美国航空静电喷雾系统的发展历史与中国应用现状" />
					</div>
				</div>
			<!-- </div> -->
			<br/>
			<!-- <div class="col-lg-12" style="margin-top: 10px;"> -->
				<div class="form-group">
					<div class="col-md-2" style="text-align:center">
						<label for="inputPhone" class="control-label pull-left"><h4>关键字（keywords）:</h4></label>
					</div>
					<br/>
					<div class="col-md-12">
						<input id="key" type="text" class="form-control"  name="key" value="喷雾;农业航空;静电喷雾;雾滴沉积;航空植保" />
					</div>
				</div>
			<!-- </div> -->
			<!-- <div class="col-lg-12" style="margin-top: 10px;"> -->
				<div class="form-group">
					<div class="col-md-2" style="text-align:center">
						<label for="inputPhone" class="control-label pull-left"><h4>摘要（summary）:</h4></label>
					</div>
					<br/>
					<div class="col-md-12">
						<textarea id="digest" name="digest" rows="4" class="form-control">航空静电喷雾系统是传统静电喷雾技术在空中操作平台上的专门应用,是航空植保技术的重要内容.美国在上个世纪60年代开始开展航空静电喷雾的技术研究,本文着重介绍了美国航空静电喷雾系统近50a的发展历史和相关的测试工作,包括航空静电喷雾系统的早期研究和持续改进,以及最终的系统模型确定.航空静电喷雾系统可有效减少施药液量和提高药液沉积量,但是仍然存在如何提高病虫害防治效果和减少下风处的喷雾飘移等方面的问题,航空静电喷雾系统针对不同作物和病虫害的适用范围和最佳作业条件还需要进一步的研究和探索.然而,航空静电喷雾系统的巨大优势已经奠定了地位.</textarea>
					</div>
				</div>
			<!-- </div> -->
			<!-- <div class="col-lg-12" style="margin-top: 10px;"> -->
				<div class="form-group">
					<div class="col-md-2" style="text-align:center">
						<label for="inputPhone" class="control-label pull-left"><h4>正文（text）:</h4></label>
					</div>
					<br/>
					<div class="col-md-12">
						<textarea id="text" name="text" rows="4" class="form-control"></textarea>
					</div>
				</div>
			<!-- </div> -->
			<div class="col-lg-12" style="margin-top: 10px;">
				<a href="#" onclick="submitForm();" class="btn btn-success pull-left" >提交文本<i class="fa fa-rocket"></i></a>
			</div>
			<!-- style="margin-left: 100px;" -->
		</div>
		
		<div class="row" style="margin-top: 10px;">
			<div class="col-lg-12">
				<!-- <ul id="generalTab" class="nav nav-tabs ul-edit responsive">
					<li class="active"><a href="#dp-1" data-toggle="tab">词性标注</a></li>
					<li><a href="#dp-2" data-toggle="tab">基于词表标注</a></li>
					<li><a href="#dp-3" data-toggle="tab">实体识别</a></li>
					<li><a href="#dp-4" data-toggle="tab">依存句法分析</a></li>
					<li><a href="#dp-5" data-toggle="tab">自动摘要</a></li>
					<li><a href="#dp-6" data-toggle="tab">关键词提取</a></li>
					<li><a href="#dp-7" data-toggle="tab">语义联想</a></li>
				</ul> -->
				<div  class="tab-content responsive" style="min-height:300px">
					<!-- <div id="dp-1" class="tab-pane fade in active">
						<div class="row" >
							<div class="col-lg-8" id="posbywordHtml">
								<h4>结果集：</h4>
								<button type="button" class="btn" style="margin-bottom: 5px; background-color: #EEDFCC; border: 1px solid #EEDFCC;">数据为空！</button>
							</div>
							<div class="col-lg-4" id="posbywordCategoryHtml">
								<h4>词性类别图示:</h4>
								<button type="button" class="btn" style="margin-bottom: 5px; background-color: #EEDFCC; border: 1px solid #EEDFCC;">数据为空！</button>
							</div>
						</div>
						
					</div> -->
					
					<div id="dp-2" class="tab-pane fade in active">
						<div class="row">
							<div class="col-lg-8" id="posTaggingHtml">
								<h4>结果集：</h4>
								<button type="button" class="btn" style="margin-bottom: 5px; background-color: #EEDFCC; border: 1px solid #EEDFCC;">数据为空！</button>
							</div>
							<div class="col-lg-4" id="posCategoryHtml">
								<h4>词性类别图示:</h4>
								<button type="button" class="btn" style="margin-bottom: 5px; background-color: #EEDFCC; border: 1px solid #EEDFCC;">数据为空！</button>
							</div>
						</div>
					</div>
					
					<!-- <div id="dp-3" class="tab-pane fade">
						<div class="row">
							<div class="col-lg-8" id="recHtml">
								<h4>结果集：</h4>
								<button type="button" class="btn" style="margin-bottom: 5px; background-color: #EEDFCC; border: 1px solid #EEDFCC;">数据为空！</button>
							</div>
							<div class="col-lg-4" id="recCategoryHtml">
								<h4>词表来源:</h4>
								<button type="button" class="btn" style="margin-bottom: 5px; background-color: #EEDFCC; border: 1px solid #EEDFCC;">数据为空！</button>
							</div>
						</div>
					</div>
					
					依存句法分析
					<div id="dp-4" class="tab-pane fade">
						<div class="row">
							<div class="col-lg-12">
								
								<dd class="mod_result_content result_sentence dependency_chart" style="overflow: auto;">
									数据为空！
								</dd>
								<dd class="mod_result_content result_tabs dependency_text">
									<div class="result_tabs_wrap result_tabs_wrap_first">
									</div>
								</dd>
								
							</div>
							 
						</div>
					</div>
					
					自动摘要
					<div id="dp-5" class="tab-pane fade">
						<div class="row">
							<div class="col-lg-12"  id="autoSummary">
								<div class="note">
                                    <p>数据为空！</p>
                                </div>
							</div>
						</div>
					</div>
					
					关键词提取
					<div id="dp-6" class="tab-pane fade">
						<div class="row">
						
							 <div class="col-lg-12"  id="autoKeyword">
								 <button type="button" class="btn" style="margin-bottom: 5px; background-color: #EEDFCC; border: 1px solid #EEDFCC;">数据为空！</button>
							</div>
							
						</div>
					</div>
					
					语义联想
					<div id="dp-7" class="tab-pane fade">
						<div class="row" id="wordDistanceHtml">
							<p>&nbsp;&nbsp; 数据为空！</p> 
						</div>
					</div> -->
					
					
				</div>
			</div>
		</div>
		
		

	</div>
	<!--END CONTENT-->
</div>

<link type="text/css" rel="stylesheet" href="static/dependency.css">

<script type="text/javascript" src="static/d3.min.js"></script>
<script type="text/javascript" src="static/lex.js"></script>
<script type="text/javascript" src="static/dependency.js"></script>

<SCRIPT type="text/javascript">

function submitForm() {
	var title = $("#title").val();
	var key = $("#key").val();
	var digest = $("#digest").val();
	var text = $("#text").val();
	if($.trim(title).length<1 && $.trim(key).length<1 && $.trim(digest).length<1 && $.trim(text).length<1) {
		alert("请输入待处理文本");
		return false;
	}
	submitPosTagging(title,key,digest,text);
	/* submitPosByWord(title,key,digest,text);
	submitRecognizeEntity(title,key,digest,text);
	submitDependencyParser(title,key,digest,text);
	submitAutoSummary(title,key,digest,text);
	submitAutoKeyword(title,key,digest,text);
	var wordDistanceText=title+key+digest+text;
	submitWordDistance(wordDistanceText); */
}

//基于词表标注
function submitPosTagging(title,key,digest,text) {
	$.ajax({
		type: "post",
		url: "nlp-demo-posTagging.html",
		data: {
			"title": title,
			"keywords": key,
			"summary": digest,
			"text": text,
		},
		dataType: "json",
		success: function(data) {
			var posTaggingHtml = '<h4>结果集：</h4>';
			var posCategoryHtml = '<h4>词性类别图示:</h4>';
			if(data!=null && data!='') {
			posTaggingHtml +="<div style='margin-top: 10px;font-size:18px;'>title:&nbsp;&nbsp;&nbsp;"+data[0].title+"</div>"
							+"<div style='margin-top: 10px;font-size:18px;'>keywords:&nbsp;&nbsp;&nbsp;"+data[0].keywords+"</div>"
							+"<div style='margin-top: 10px;font-size:18px;'>summary:&nbsp;&nbsp;&nbsp;"+data[0].summary+"</div>"
							+"<div style='margin-top: 10px;font-size:18px;'>text:&nbsp;&nbsp;&nbsp;"+data[0].text+"</div>"
				 /* $(data[0].posTaggingList).each(function(i) {
					 posTaggingHtml += ' <button type="button" class="btn" style="margin-bottom: 5px; background-color: ' 
					 + data[0].posTaggingList[i].color + '; border: 1px solid ' + data[0].posTaggingList[i].color + ';">' 
					 + data[0].posTaggingList[i].word + '</button>';
			  	 });
				 $(data[0].posCategoryList).each(function(i) {
					 posCategoryHtml += ' <button type="button" class="btn" style="margin-bottom: 5px; background-color: ' 
					 + data[0].posCategoryList[i].color + '; border: 1px solid ' + data[0].posCategoryList[i].color + ';">' 
					 + data[0].posCategoryList[i].name + '</button>';
			  	 }); */
			  	 posCategoryHtml +="<button type='button' class='btn' style='margin-bottom: 5px; color:#ffffff; background-color: "+data[0].labelNameColor+"; border: 1px solid "+data[0].labelNameColor+";'>"+data[0].labelName+"</button>"
								  +"&nbsp;&nbsp;<button type='button' class='btn' style='margin-bottom: 5px; background-color: "+data[0].labelTextColor+"; border: 1px solid "+data[0].labelTextColor+";'>"+data[0].labelText+"</button>"
			}
			$("#posTaggingHtml").html(posTaggingHtml);
			$("#posCategoryHtml").html(posCategoryHtml);
			
		},
		error : function(data) {
			// alert("请求失败");
		}
	});
}


</SCRIPT>


<?} ?>

